home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_shs_doorrotstep.cog < prev    next >
Text File  |  1999-11-15  |  2KB  |  83 lines

  1. # Jones 3D Cog Script
  2. #
  3. # gen_DoorRotStep.cog
  4. #
  5. # Rotating Door triggered by the floor
  6. #
  7. # [RKD]
  8. #
  9. # (C) 1997 LucasArts Entertainment Co. All Rights Reserved
  10. # ========================================================================================
  11.  
  12. symbols
  13.  
  14. message    startup        
  15. message    entered    
  16. message    arrived        
  17. message    blocked        
  18.  
  19. thing        door
  20.  
  21. surface    switch
  22.  
  23. int      open=0                local
  24.  
  25. flex        duration=1.0
  26.  
  27. sector    doorSector            local
  28. end
  29.  
  30. # ========================================================================================
  31.  
  32. code
  33.  
  34. startup:
  35.     Print("Startup");
  36.     doorSector = GetThingSector(door);
  37.     SetSectorAdjoins(doorSector, 0);
  38.  
  39.     return;
  40.  
  41. # ........................................................................................
  42.  
  43. entered:
  44.     Print("Entered");
  45. ##    Playsound(click);
  46.  
  47.     if (isMoving(door)) return;
  48.     if (GetSenderRef() == door) return;
  49.         
  50.     if (open == 0)                        // open or close door depending on current status 
  51.     {
  52.         PrintInt(open);
  53.         Rotate(door, 90, duration);
  54.         SetSectorAdjoins(doorSector, 1);     
  55.     }
  56.     else
  57.     {
  58.         PrintInt(open);
  59.         Rotate(door, -90, duration);
  60.     }
  61.     
  62.    return;
  63.  
  64. # ........................................................................................
  65.  
  66. arrived:    
  67.  
  68.     Print("Door arrived");
  69.     open = 1 - open;
  70.     SetSectorAdjoins(doorSector, open);  
  71.  
  72.     return;
  73.  
  74. # ........................................................................................
  75.  
  76. blocked:
  77.     Print("Blocked");
  78. #    ?????    
  79.     return;
  80.  
  81. end
  82.  
  83.